main() {
  {
    var x = 1;
    var hex = 0xDEADBEEF;
    print(x);
    print(hex); //3735928559

    var y = 1.1;
    var exponents = 1.42e5;
    print(y);
    print(exponents); //142000.0
  }

  {
    // String -> int.dart
    var one = int.parse('1');
    print(one);
    print(one == 1);

    // String -> double
    var onePointOne = double.parse('1.1');
    assert(onePointOne == 1.1);

    // int.dart -> String
    String oneAsString = 1.toString();
    print(oneAsString == "1");
    print(oneAsString == '1');
    print(oneAsString == """1""");
    assert(oneAsString == '1');

    // double -> String
    String piAsString = 3.14159.toStringAsFixed(2);
    print(piAsString == '3.14');
    assert(piAsString == '3.14');
  }

  {
    var s = r'In a raw string, not even \n gets special treatment.';
    print(s);
    s = 'In a raw string, not even \n gets special treatment.';
    print(s);

    var s1 = '''
You can create
multi-line strings like this one.
''';
    print(s1);

    var s2 = """This is also a
multi-line string.""";
    print(s2);
  }
  var s3 = 'String '
      'concatenation'
      " works even over line breaks.";
  print(s3);

  {
    print(true);
    print(false);
    print(1 is int);
    print("" is String);
    print([] is List);
    print({} is Map);
    print("".isEmpty);
    print("1".isNotEmpty);
  }

  {
    var list = [1, 2, 3];
    print(list);
    print(list[0]);
    print(list.length);
    list.forEach((element) {
      print(element);
    });
    list.add(4);
    print(list);
    print([10, 20, ...list]);
    print([
      ...list,
      10,
      20,
    ]);

    var list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
    print(['#0', for (var i in list1) '#$i']);
    print(['#0', for (var i in list1) if (i % 2 == 0) '#$i']);
  }

  {
    var halogens = {'fluorine', 'chlorine', 'bromine', 'iodine', 'astatine'};
    print(halogens);

    var elements = <String>{};
    elements.add('fluorine');
    elements.add('fluorine1');
    elements.addAll(halogens);
    print(elements);

    final constantSet = const {
      'fluorine',
      'chlorine',
      'bromine',
      'iodine',
      'astatine',
    };
    print(constantSet);
  }

  {
    var gifts = {
      // Key:    Value
      'first': 'partridge',
      'second': 'turtledoves',
      'fifth': 'golden rings'
    };

    var nobleGases = {
      2: 'helium',
      10: 'neon',
      18: 'argon',
    };
    print([gifts, nobleGases]);
  }

  {
    var gifts = {'first': 'partridge'};
    gifts['fourth'] = 'calling birds'; // Add a key-value pair
    print(gifts);
  }
}
